from django.shortcuts import render

# Create your views here.
from rest_framework.generics import CreateAPIView
from rest_framework.viewsets import ModelViewSet

from rest_framework_jwt.views import ObtainJSONWebToken

from user.serializers import *
from utils.permission import BackendPermission


class UserBackendLoginAPIView(ObtainJSONWebToken):
    serializer_class = UserBackendLoginTokenSerializer


class UserBackendViewSet(ModelViewSet):
    """
    boss/店员对用户数据的操作
    """
    queryset = User.objects.filter(is_deleted='0')
    permission_classes = [BackendPermission]
    serializer_class = UserBackendSerializer



